var apiwriter = require('apiwriter');

exports.getContext = function() {
    return {
        createdId: null
    };
};

exports.submitRequests = function()
{
    apiwriter.postJson('/comments', {"title":"A comment", "author":"me", "discussionId":1},
        function(context, result) {
            context.createdId = result.responseBody.id;
        });

    apiwriter.postJson('/comments', {"title":"Another comment", "author":"me", "discussionId":1});
    apiwriter.getJson('/comments');
    apiwriter.getJson('/comments/{createdId}');
    apiwriter.deleteJson('/comments/{createdId}');
}

